﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConfigUtility;
using System.IO;

namespace VFTray.Config
{
    public class ConfigurationDevice : IConfig
    {
        public bool LogOn = true;
        public bool OSK = false;

		public double AutoAuthCloseSeconds = 30;
        public string UserFile = Path.Combine(Environment.CurrentDirectory, "user.fus");

		public string RecipeBootPath = Path.Combine(Environment.CurrentDirectory, "Recipe");
        public string RecipeName = "default";
        public string GetRecipeFile()
        {
            string fn = Path.Combine(RecipeBootPath, RecipeName);
            return Path.Combine(fn, RecipeName + ".xml");
        }

        public bool SaveImageO = false;
        public string ImagesPathO = Path.Combine(Environment.CurrentDirectory, "images");


        public List<CfgFeedTray> Trayes = new List<CfgFeedTray>();

        public CfgComServer ComServer = new CfgComServer();
        public CfgWndLayout WndLayout = new CfgWndLayout();

        public int TimeoutCV = 30 * 1000;//ms


        public void afterLoad()
        {
			if (Trayes.Count == 0) Trayes.Add(new CfgFeedTray());
            WndLayout.afterLoad();
        }

        public void InitParamsClass()
        {
			if (Trayes.Count == 0) Trayes.Add(new CfgFeedTray());
            WndLayout.InitParamsClass();
        }
    }
}
